#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import os.path

from setuptools import setup
from setuptools import find_packages
from setuptools import Extension


PYCXX_VER = '6.2.0'
CXX_INCDIR = os.path.join('3rdparty', 'pycxx-' + PYCXX_VER)
CXX_INCDIR = os.path.normpath(CXX_INCDIR)
CXX_SRCDIR = os.path.join('3rdparty', 'pycxx-' + PYCXX_VER, 'Src')
CXX_SRCDIR = os.path.normpath(CXX_SRCDIR)


module = Extension('ctpp2._ctpp2',
                   sources=[
                       os.path.join('src', 'ctpp2', 'ctpp2.cpp'),
                       os.path.join(CXX_SRCDIR, 'cxxsupport.cxx'),
                       os.path.join(CXX_SRCDIR, 'cxx_extensions.cxx'),
                       os.path.join(CXX_SRCDIR, 'IndirectPythonInterface.cxx'),
                       os.path.join(CXX_SRCDIR, 'cxxextensions.c')
                       ],
                   include_dirs=[
                                    '/usr/local/include/ctpp2',
                                    '/usr/include/ctpp2',
                                    '/usr/local/include',
                                    '/usr/include',
                                    '/opt/local/include/ctpp2',
                                    CXX_INCDIR
                                   ],
                   library_dirs=[
                                    '/usr/local/lib',
                                    '/usr/lib',
                                    '/opt/local/lib'
                                  ],
                   libraries=['ctpp2']
                   )


setup(
        name='ctpp2',
        namespace_packages=['ctpp2'],
        version='2.8.3',
        author="Andrei V. Shetuhin",
        author_email="reki@reki.ru",
        maintainer="Andrei V. Shetuhin",
        maintainer_email="reki@reki.ru",
        contact_email="reki@reki.ru",
        url='http://ctpp.havoc.ru',
        packages=find_packages('src'),
        package_dir={'': 'src'},
        license='BSD-like',
        description='',
        test_suite = 'test',
        ext_modules=[module]
    )

